<!doctype html>
<html>
{include file="head.html"}
<style>
.none{display:none;}
</style>
<body>
 <div class="fullscreen">
  <div class="scroll_contentx">
    <div class="topfixed">
      <div class="t_left"><a href="/index.php"><i class="back"></i></a></div>
      <div class="t_main">选择楼栋</div>
      <div class="t_right"><a class="link" href="/index.php?m=sites">{$site.sitename}</a></div>
    </div>
    <div class="paddingheight"></div>
    <div class="change_loudong">
    <div class="mainsort_box">
    	<ul class="mainsort">
          	{foreach item=c key=k from=$data}
              <li class="{if $k eq 0}cur{/if} goTab" to="goTab{$k}"><a href="JavaScript:;">{$c.title}</a></li>
            {/foreach}  
               
            </ul>
            </div>
            <div class="subsort_box" style="position:inherit">
      <ul class="subsort">
          	{foreach item=cc key=k from=$data}
            {foreach item=c from=$cc.child}
            {if $c.shopid}
            <li class="goTab{$k} goTabLi {if $k neq 0}none{/if}"><a href="/index.php?m=ymdian&id={$c.shopid}"><span class="fr {if $c.opentype eq 'doing'}green{else}red{/if}">{if $c.opentype eq 'doing'}营业中{elseif $c.opentype eq 'close'}升级中{else}休息中{/if}</span>{$cc.title} <span class="num">{$c.title}</span></a></li>
            {else}
            <li class="goTab{$k} goTabLi {if $k neq 0}none{/if}"><a href="javascript:openShop({$c.sc_id})"><span class="fr">申请开店</span>{$cc.title} <span class="num">{$c.title}</span></a></li>
             {/if}
             {/foreach}
            {/foreach}
 
            </ul>
    </div>
       
    </div>
  </div>
</div>
<div class="global_iframe" id="global_iframe">
  <div class="inner">
    <iframe src="/index.php?m=ymdian_apply" frameborder="0" scrolling="no" class="iframe" ></iframe>
  </div>
</div>
<div class="global_webmask"></div> 
<script>
$(document).on("click",".goTab",function(){
	var o=$(this);
	$(".goTab").removeClass("cur");
	$(this).addClass("cur");
	$(".goTabLi").addClass("none");
	$("."+o.attr("to")).removeClass("none");
});

//点击空白区域关闭弹窗
$(document).mouseup(function(e){
  var _con = $('.global_iframe ');   // 设置目标区域
  if(!_con.is(e.target) && _con.has(e.target).length === 0){
    _con.fadeOut('fast');
	$(".global_webmask").css("display","none");
  }
});
//开店弹窗
function openShop(id){
	$(".global_iframe .inner").html(' <iframe src="/index.php?m=ymdian_apply&sc_id='+id+'" frameborder="0" scrolling="no" class="iframe" ></iframe>');
	$(".global_iframe,.global_webmask").css("display","block");
}
function hidewin(){
	$(".global_iframe,.global_webmask").css("display","none");
}
</script>
 
</body>
</html>
